package com.maoye.ossp.common.web.taglib;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import com.maoye.ossp.sys.base.utils.SysDictUtils;

public class GetValue extends TagSupport{
	
	private static final long serialVersionUID = 1L;
	private String dictType;
	private String key;
	
	public int doStartTag() throws JspException {
		try {
			String value = SysDictUtils.getValue(dictType, key);
			if(value ==null){
				value = "";
			}
			pageContext.getOut().print(value);
			
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return EVAL_BODY_INCLUDE;
	}
	public String getDictType() {
		return dictType;
	}
	public void setDictType(String dictType) {
		this.dictType = dictType;
	}
	public String getKey() {
		return key;
	}
	public void setKey(String key) {
		this.key = key;
	}
	
	
}
